<div class="error" *ngIf="error"><cp-error (reload)="handleReload()"></cp-error></div>
<div class="loading" *ngIf="loading"><cp-loading></cp-loading></div>
<div class="container" *ngIf="!error && !loading">
  <div class="searchbar fixed-top">
    <div class="left" routerLink="/workspace/home/selectCity">
      <span class="txt">{{ city.Name }}</span> <i class="icon icon-jiantouxia"></i>
    </div>
    <div class="middle" routerLink="/workspace/home/search">
      <i class="icon icon-search"></i>
      <p class="txt">请输入楼盘名称或地址</p>
    </div>
    <div class="right" routerLink="/workspace/home/estateMap">
      <i class="icon icon-map"></i> <span class="txt">地图</span>
    </div>
  </div>
  <div class="fill"></div>
  <div class="iconbar">
    <div
      class="item"
      *ngFor="let item of iconbar"
      routerLink="/workspace/estate/index"
      [queryParams]="{ name: item.name }"
    >
      <img src="assets/images/Main/icon_module_{{ item.icon }}.png" class="img-icon" />
      <p class="name">{{ item.name }}</p>
    </div>
  </div>
  <div class="slider" *ngIf="Poster.length > 0">
    <Carousel
      [autoplay]="true"
      [autoplayInterval]="10000"
      [dotStyle]="{ marginBottom: '4px' }"
      [dotActiveStyle]="{ backgroundColor: '#fff', marginBottom: '4px' }"
    >
      <CarouselSlide *ngFor="let item of Poster">
        <div class="item" (click)="navigateTo(item.Url)"><img [src]="item.Photo" /></div>
      </CarouselSlide>
    </Carousel>
  </div>
  <div
    class="block quotation"
    routerLink="/workspace/home/quotation"
    [queryParams]="{ name: city.Name }"
    *ngIf="Quotation.show"
  >
    <div class="pubtitle">
      <div class="left">房市行情</div>
      <div class="right"><span class="value">更多行情</span> <i class="icon icon-right"></i></div>
    </div>
    <div class="content">
      <div class="list">
        <div class="item average">
          <img src="assets/images/Main/bg_average.png" />
          <div class="mask">
            <p class="name">全市均价 <i class="icon icon-folder"></i></p>
            <div class="numberbox">
              <span class="number">{{ Quotation.average }}</span> <span class="unit">元/m²</span>
            </div>
          </div>
        </div>
        <div class="item deal">
          <img src="assets/images/Main/bg_deal.png" />
          <div class="mask">
            <p class="name">本月成交 <i class="icon icon-folder"></i></p>
            <div class="numberbox">
              <span class="number">{{ Quotation.deal }}</span> <span class="unit">套</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="block activity" *ngIf="activity.length > 0">
    <div class="pubtitle" routerLink="/workspace/home/activity">
      <div class="left">热门活动</div>
      <div class="right"><span class="value">更多活动</span> <i class="icon icon-right"></i></div>
    </div>
    <div class="content">
      <div class="list">
        <div
          class="item"
          *ngFor="let item of activity"
          routerLink="/workspace/home/activityDetail"
          [queryParams]="{ promotion: item.Id }"
        >
          <img [src]="item.Photo" class="img-act" />
          <p class="title">{{ item.Title }}</p>
          <p class="desc">{{ item.Project }}</p>
        </div>
      </div>
    </div>
  </div>
  <div class="block estate" *ngIf="estates.length > 0">
    <div class="pubtitle"><div class="left">推荐楼盘</div></div>
    <div class="content">
      <div class="list">
        <div
          class="item"
          *ngFor="let item of estates; trackBy: trackByFn"
          [queryParams]="{ project: item.Id }"
          routerLink="/workspace/estate/detail"
        >
          <cp-estate-item [item]="item"></cp-estate-item>
        </div>
      </div>
      <cp-loadmore *ngIf="estates.length > 0 && !nomore"></cp-loadmore>
      <div class="gutter" *ngIf="estates.length > 0 && nomore"></div>
    </div>
  </div>
</div>
<cp-popup [(show)]="Notice.show">
  <div class="popup">
    <div class="content" (click)="navigateTo(Notice.url)"><img [src]="Notice.img" /></div>
    <div class="footer">
      <div class="line"></div>
      <i class="icon icon-close" (click)="Notice.show = false"></i>
    </div>
  </div>
</cp-popup>
<cp-tabbar></cp-tabbar>
